using System;
using System.Collections.Generic;
using System.Text;
using CodePlex.Resourceful;
using CodePlex.Resourceful.Amazon.S3;

namespace CodePlex.SpaceBlock
{

    public interface IFileSystem
    {

        Tracer Tracer { get; }
        string Caption { get;}
        string ShortCaption { get; }
      
        bool Exists(Path path);

        void EnsureFolderExists(Path path);

        void EnsureFileExists(Path path);

        void Delete(Path path);

        ReadOnlyList<IPathItem> GetItems(Path path);
        ReadOnlyList<IFolderItem> GetFolders(Path path);
        ReadOnlyList<IFileItem> GetFiles(Path path);
        

        IPathItem GetItem(Path path);

        void Transfer(IFileItem source, Path destination, NameValuePairs metadata, Action<long> bytesTransferred);

        Metadata GetMetadata(Path path);
        
        string ToLocalPath(Path path);

        // acl 
        ACL GetACL(Path path);
        void SetACL(Path path, ACL acl);
        ReadOnlyList<ACLPrincipal> GetPrincipals();
        ReadOnlyList<string> GetPermissions();
       
    }

    public interface IPathItem
    {
        IFileSystem FileSystem { get; }
        Path Path { get; }
        DateTime? LastModified { get; }
    }

    public interface IFolderItem : IPathItem
    {
        
    }

    public interface IFileItem : IPathItem
    {
        long Size { get; }
        byte[] QuickMD5 { get; }
        System.IO.Stream GetInputStream();
    }

    public interface ISupportsFileSystem
    {
        IFileSystem FileSystem { get; }
    }


}
